<template>
	<view id="server">
		<div class="serverCont">
			请大家按照要求进行预约哦～！
		</div>
		<div class="serverCont_items" @click='addServer(1)'>
			<image src="https://wx.sjcmhz.com/static/image/xingzheng_baoxiu.png" mode=""></image>
		</div>
		<div class="serverCont_items" @click='addServer(2)'>
			<image src="https://wx.sjcmhz.com/static/image/xingzheng_baojie.png" mode=""></image>
		</div>
		<div class="serverCont_items" @click='addServer(3)'>
			<image src="https://wx.sjcmhz.com/static/image/xingzheng_zdy.png" mode=""></image>
		</div>
	</view>
</template>

<script>
	import tab from './components/tab.vue'
	import list from './components/list.vue'
	export default {
		components: {
			tab,
			list
		},
		data() {
			return {
				list: {
					img: 'https://wx.sjcmhz.com/static/serve/dg.png',
					name: '灯光/美颜',
					time: [{
						num: 1,
						time: '09:00~10:00'
					}, {
						num: 1,
						time: '10:00~11:00 '
					}, {
						num: 1,
						time: '11:00~12:00 '
					}, {
						num: 1,
						time: '12:30 ~14:00'
					}, {
						num: 1,
						time: '14:00～15:00 '
					}, {
						num: 1,
						time: '15:00～17:20'
					}, {
						num: 1,
						time: '18:00～21:00 '
					}, {
						num: 1,
						time: '21:00～22:00'
					}, ]
				},
				listOne: [],
				listShow: true,
				moType: 0
			};
		},
		onLoad(opt) {

		},
		onHide() {
			console.log('页面被关闭了');
			uni.removeStorageSync('smoId')
			uni.setStorageSync('smoId', 0)
		},
		onShow() {
			this.$utils.isLogin()
			this.listOne = this.list
			this.moType = uni.getStorageSync('smoId') || 0
			this.tabChangeType(this.moType)
			console.error('onShowonShowonShowonShowonShow', this.moType)
		},
		onLaunch() {
			console.log('页面被关闭了');
			uni.removeStorageSync('smoId')
			uni.setStorageSync('smoId', 0)
		},
		methods: {
			addServer(type) {
				// this.addServer = type
				if (type == 1) {
					uni.navigateTo({
						url: '/pagesA/index/server/upDataServe?type=' + type
					})
				} else {
					uni.navigateTo({
						url: '/pagesA/index/server/updateZDY?type=' + type
					})
				}

			},
			tabChangeType(v) {
				this.listShow = false
				switch (v) {
					case 0:
						this.listOne = this.list
						break;
					case 1:
						this.listOne = this.list1
						break;
					case 2:
						this.listOne = this.list2
						break;
					case 3:
						this.listOne = this.list3
						break;
					case 4:
						this.listOne = this.list4
						break;

				}
				this.listShow = true
				this.moType = v

				console.log("vv", v, this.listOne)
			}
		},
	};
</script>

<style lang="scss">
	.serverCont {
		width: 750rpx;
		height: 82rpx;
		background: #FFFFFF;
		font-size: 32rpx;
		color: #F5A623;
		line-height: 82rpx;
		padding: 0 40rpx;

	}

	.serverCont_items {
		width: 100%;
		height: 228rpx;
		background: #fff;
		padding: 32rpx;
		box-sizing: border-box;
		margin-top: 20rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.tabar {
		background: #fff;
		margin-top: 20rpx;
		padding: 32rpx 0;
	}

	.serverList {
		background: #fff;
		margin-top: 25rpx;
		margin-bottom: 50rpx;
	}
</style>